<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui"
	xmlns:ui="http://java.sun.com/jsf/facelets">

<h:head></h:head>

	<h:body>
        
        <div id="logoHomePage" align="left">
			<a href="..\homepage.xhtml"><img src="grafica\TravelDream_Logo.gif" width="150" height="75"/></a>
		</div>
		
		<div id="logout" align="right">
        	<h:form>
        	           	<a href="users\index.xhtml">Pagina Personale</a>
        	
				<h:commandButton action="#{logoutBean.logout}" value="Logout" />
			</h:form>
		</div>
		
		<h:form>
		<p:panel header="Carrello">
			<h:panelGrid columns="3" id="carrelloGrid">
				
				<p:dataTable value="#{carrelloBean.result}" var="result">  		        			
		        	<p:column headerText="Nome Pacchetto"> 
		       			#{result.pacchetto.nome}   
		        	</p:column>
		        	<p:column headerText="Num Posti"> 
		       			#{result.numPosti}  
		        	</p:column>
		        	<p:column headerText="Prezzo"> 
		       			#{result.prezzo}
		        	</p:column>
		        	<p:column headerText="Invita">
						<p:inputText id="emailInvitato" value="#{invitoBean.nuovoInvito.destinatario}" />
						<h3>Testo</h3>
						<p:inputTextarea rows="6" cols="33" value="#{invitoBean.nuovoInvito.testo}"/>
		       			<p:commandButton value="Invita" action="#{invitoBean.invita(result.idAcquisto)}" />
		        	</p:column>
		   		</p:dataTable>
				
			</h:panelGrid>
			<p:commandButton value="VisualizzaCarrello" update="carrelloGrid" action="#{carrelloBean.findByUser()}" />

		</p:panel>
	</h:form>
    </h:body>

</html>
